import type { AxiosResponse } from 'axios'
import request from '@/utils/request'

const serviceName = import.meta.env.VITE_APP_SREVICE_NAME_CITY_MANAGEMENT

/**
 * 消息页接口
 */
class MsgServe {
  /**
   * 获取消息列表
   */
  getMessageList<T = any>(): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzMessage/getMessageList`,
      method: 'get'
    })
  }
  /**
   * 批量修改已读状态
   */
  updateSendStatus<T = any>(params: RecordType): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzMessage/updateSendStatus`,
      method: 'get',
      params
    })
  }
  /**
   * 批量删除消息
   */
  deleteMessage<T = any>(params: RecordType): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzMessage/deleteMessage`,
      method: 'get',
      params
    })
  }
  /**
   * 根据id获取消息详情
   */
  getMessageById<T = any>(params: RecordType): Promise<AxiosResponse<T>> {
    return request({
      url: `${serviceName}/cgjybzMessage/getMessageById`,
      method: 'get',
      params
    })
  }
}

export default new MsgServe()
